package b.s.a.a;

import android.animation.Keyframe;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.InflateException;
import android.view.animation.AnimationUtils;
import b.i.b.f;
import b.i.c.b.h;
import java.util.ArrayList;
import java.util.Objects;
import org.xmlpull.v1.XmlPullParser;

/* compiled from: AnimatorInflaterCompat */
public class c {

    /* compiled from: AnimatorInflaterCompat */
    public static class a implements TypeEvaluator<b.i.d.c[]> {
        public b.i.d.c[] a;

        public Object evaluate(float f, Object obj, Object obj2) {
            b.i.d.c[] cVarArr = (b.i.d.c[]) obj;
            b.i.d.c[] cVarArr2 = (b.i.d.c[]) obj2;
            if (f.I(cVarArr, cVarArr2)) {
                if (!f.I(this.a, cVarArr)) {
                    this.a = f.o0(cVarArr);
                }
                for (int i = 0; i < cVarArr.length; i++) {
                    Object obj3 = this.a[i];
                    b.i.d.c cVar = cVarArr[i];
                    b.i.d.c cVar2 = cVarArr2[i];
                    Objects.requireNonNull(obj3);
                    obj3.a = cVar.a;
                    int i2 = 0;
                    while (true) {
                        float[] fArr = cVar.b;
                        if (i2 >= fArr.length) {
                            break;
                        }
                        obj3.b[i2] = (cVar2.b[i2] * f) + ((1.0f - f) * fArr[i2]);
                        i2++;
                    }
                }
                return this.a;
            }
            throw new IllegalArgumentException("Can't interpolate between two incompatible pathData");
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:153:0x02d0  */
    /* JADX WARNING: Removed duplicated region for block: B:155:0x02d6  */
    /* JADX WARNING: Removed duplicated region for block: B:175:0x0329  */
    public static android.animation.Animator a(android.content.Context r22, android.content.res.Resources r23, android.content.res.Resources.Theme r24, org.xmlpull.v1.XmlPullParser r25, android.util.AttributeSet r26, android.animation.AnimatorSet r27, int r28, float r29) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        /*
        r8 = r23;
        r9 = r24;
        r10 = r25;
        r11 = r27;
        r12 = r25.getDepth();
        r0 = 0;
        r1 = 0;
        r13 = r1;
    L_0x000f:
        r1 = r25.next();
        r2 = 3;
        r14 = 0;
        if (r1 != r2) goto L_0x001d;
    L_0x0017:
        r3 = r25.getDepth();
        if (r3 <= r12) goto L_0x0350;
    L_0x001d:
        r3 = 1;
        if (r1 == r3) goto L_0x0350;
    L_0x0020:
        r4 = 2;
        if (r1 == r4) goto L_0x0024;
    L_0x0023:
        goto L_0x000f;
    L_0x0024:
        r1 = r25.getName();
        r5 = "objectAnimator";
        r5 = r1.equals(r5);
        if (r5 == 0) goto L_0x004a;
    L_0x0030:
        r7 = new android.animation.ObjectAnimator;
        r7.<init>();
        r0 = r22;
        r1 = r23;
        r2 = r24;
        r3 = r26;
        r4 = r7;
        r5 = r29;
        r6 = r25;
        e(r0, r1, r2, r3, r4, r5, r6);
        r0 = r7;
    L_0x0046:
        r18 = r12;
        goto L_0x0323;
    L_0x004a:
        r5 = "animator";
        r5 = r1.equals(r5);
        if (r5 == 0) goto L_0x0064;
    L_0x0052:
        r4 = 0;
        r0 = r22;
        r1 = r23;
        r2 = r24;
        r3 = r26;
        r5 = r29;
        r6 = r25;
        r0 = e(r0, r1, r2, r3, r4, r5, r6);
        goto L_0x0046;
    L_0x0064:
        r5 = "set";
        r5 = r1.equals(r5);
        if (r5 == 0) goto L_0x00a7;
    L_0x006c:
        r15 = new android.animation.AnimatorSet;
        r15.<init>();
        r0 = b.s.a.a.a.h;
        r7 = r26;
        r6 = b.i.c.b.h.e(r8, r9, r7, r0);
        r0 = "ordering";
        r0 = b.i.c.b.h.c(r10, r0);
        if (r0 != 0) goto L_0x0085;
    L_0x0081:
        r0 = 0;
        r16 = 0;
        goto L_0x008b;
    L_0x0085:
        r0 = r6.getInt(r14, r14);
        r16 = r0;
    L_0x008b:
        r0 = r22;
        r1 = r23;
        r2 = r24;
        r3 = r25;
        r4 = r26;
        r5 = r15;
        r17 = r6;
        r6 = r16;
        r7 = r29;
        a(r0, r1, r2, r3, r4, r5, r6, r7);
        r17.recycle();
        r18 = r12;
        r0 = r15;
        goto L_0x0323;
    L_0x00a7:
        r5 = "propertyValuesHolder";
        r1 = r1.equals(r5);
        if (r1 == 0) goto L_0x0339;
    L_0x00af:
        r1 = android.util.Xml.asAttributeSet(r25);
        r6 = 0;
    L_0x00b4:
        r7 = r25.getEventType();
        if (r7 == r2) goto L_0x02fd;
    L_0x00ba:
        if (r7 == r3) goto L_0x02fd;
    L_0x00bc:
        if (r7 == r4) goto L_0x00c2;
    L_0x00be:
        r25.next();
        goto L_0x00b4;
    L_0x00c2:
        r7 = r25.getName();
        r7 = r7.equals(r5);
        if (r7 == 0) goto L_0x02e7;
    L_0x00cc:
        r3 = b.s.a.a.a.i;
        r3 = b.i.c.b.h.e(r8, r9, r1, r3);
        r7 = "propertyName";
        r7 = b.i.c.b.h.b(r3, r10, r7, r2);
        r14 = "valueType";
        r14 = b.i.c.b.h.c(r10, r14);
        r15 = 4;
        if (r14 != 0) goto L_0x00e3;
    L_0x00e1:
        r4 = 4;
        goto L_0x00e7;
    L_0x00e3:
        r4 = r3.getInt(r4, r15);
    L_0x00e7:
        r14 = b.s.a.a.a.j;
        r15 = 0;
        r16 = r1;
        r1 = r4;
        r17 = r5;
    L_0x00ef:
        r5 = r25.next();
        if (r5 == r2) goto L_0x01ee;
    L_0x00f5:
        r2 = 1;
        if (r5 == r2) goto L_0x01ee;
    L_0x00f8:
        r2 = r25.getName();
        r5 = "keyframe";
        r2 = r2.equals(r5);
        if (r2 == 0) goto L_0x01e1;
    L_0x0104:
        r2 = "value";
        r5 = 4;
        if (r1 != r5) goto L_0x0136;
    L_0x0109:
        r1 = android.util.Xml.asAttributeSet(r25);
        r1 = b.i.c.b.h.e(r8, r9, r1, r14);
        r5 = b.i.c.b.h.c(r10, r2);
        if (r5 != 0) goto L_0x0119;
    L_0x0117:
        r5 = 0;
        goto L_0x011e;
    L_0x0119:
        r5 = 0;
        r5 = r1.peekValue(r5);
    L_0x011e:
        if (r5 == 0) goto L_0x0123;
    L_0x0120:
        r18 = 1;
        goto L_0x0125;
    L_0x0123:
        r18 = 0;
    L_0x0125:
        if (r18 == 0) goto L_0x0131;
    L_0x0127:
        r5 = r5.type;
        r5 = d(r5);
        if (r5 == 0) goto L_0x0131;
    L_0x012f:
        r5 = 3;
        goto L_0x0132;
    L_0x0131:
        r5 = 0;
    L_0x0132:
        r1.recycle();
        r1 = r5;
    L_0x0136:
        r5 = android.util.Xml.asAttributeSet(r25);
        r5 = b.i.c.b.h.e(r8, r9, r5, r14);
        r8 = "fraction";
        r8 = b.i.c.b.h.c(r10, r8);
        r9 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
        if (r8 != 0) goto L_0x0149;
    L_0x0148:
        goto L_0x014e;
    L_0x0149:
        r8 = 3;
        r9 = r5.getFloat(r8, r9);
    L_0x014e:
        r8 = b.i.c.b.h.c(r10, r2);
        if (r8 != 0) goto L_0x0156;
    L_0x0154:
        r8 = 0;
        goto L_0x015b;
    L_0x0156:
        r8 = 0;
        r8 = r5.peekValue(r8);
    L_0x015b:
        r18 = r12;
        r12 = 4;
        if (r8 == 0) goto L_0x0163;
    L_0x0160:
        r19 = 1;
        goto L_0x0165;
    L_0x0163:
        r19 = 0;
    L_0x0165:
        if (r1 != r12) goto L_0x0175;
    L_0x0167:
        if (r19 == 0) goto L_0x0173;
    L_0x0169:
        r8 = r8.type;
        r8 = d(r8);
        if (r8 == 0) goto L_0x0173;
    L_0x0171:
        r8 = 3;
        goto L_0x0176;
    L_0x0173:
        r8 = 0;
        goto L_0x0176;
    L_0x0175:
        r8 = r1;
    L_0x0176:
        if (r19 == 0) goto L_0x01a7;
    L_0x0178:
        if (r8 == 0) goto L_0x0194;
    L_0x017a:
        r12 = 1;
        if (r8 == r12) goto L_0x0182;
    L_0x017d:
        r12 = 3;
        if (r8 == r12) goto L_0x0182;
    L_0x0180:
        r2 = 0;
        goto L_0x01b2;
    L_0x0182:
        r2 = b.i.c.b.h.c(r10, r2);
        if (r2 != 0) goto L_0x018a;
    L_0x0188:
        r2 = 0;
        goto L_0x018f;
    L_0x018a:
        r2 = 0;
        r2 = r5.getInt(r2, r2);
    L_0x018f:
        r2 = android.animation.Keyframe.ofInt(r9, r2);
        goto L_0x01b2;
    L_0x0194:
        r8 = 0;
        r2 = b.i.c.b.h.c(r10, r2);
        if (r2 != 0) goto L_0x019d;
    L_0x019b:
        r2 = 0;
        goto L_0x01a2;
    L_0x019d:
        r2 = 0;
        r2 = r5.getFloat(r8, r2);
    L_0x01a2:
        r2 = android.animation.Keyframe.ofFloat(r9, r2);
        goto L_0x01b2;
    L_0x01a7:
        if (r8 != 0) goto L_0x01ae;
    L_0x01a9:
        r2 = android.animation.Keyframe.ofFloat(r9);
        goto L_0x01b2;
    L_0x01ae:
        r2 = android.animation.Keyframe.ofInt(r9);
    L_0x01b2:
        r8 = "interpolator";
        r8 = b.i.c.b.h.c(r10, r8);
        if (r8 != 0) goto L_0x01bc;
    L_0x01ba:
        r8 = 0;
        goto L_0x01c2;
    L_0x01bc:
        r8 = 1;
        r9 = 0;
        r8 = r5.getResourceId(r8, r9);
    L_0x01c2:
        r9 = r22;
        if (r8 <= 0) goto L_0x01cd;
    L_0x01c6:
        r8 = android.view.animation.AnimationUtils.loadInterpolator(r9, r8);
        r2.setInterpolator(r8);
    L_0x01cd:
        r5.recycle();
        if (r2 == 0) goto L_0x01dd;
    L_0x01d2:
        if (r15 != 0) goto L_0x01da;
    L_0x01d4:
        r5 = new java.util.ArrayList;
        r5.<init>();
        r15 = r5;
    L_0x01da:
        r15.add(r2);
    L_0x01dd:
        r25.next();
        goto L_0x01e5;
    L_0x01e1:
        r9 = r22;
        r18 = r12;
    L_0x01e5:
        r2 = 3;
        r8 = r23;
        r9 = r24;
        r12 = r18;
        goto L_0x00ef;
    L_0x01ee:
        r9 = r22;
        r18 = r12;
        if (r15 == 0) goto L_0x02ca;
    L_0x01f4:
        r2 = r15.size();
        if (r2 <= 0) goto L_0x02ca;
    L_0x01fa:
        r5 = 0;
        r5 = r15.get(r5);
        r5 = (android.animation.Keyframe) r5;
        r8 = r2 + -1;
        r8 = r15.get(r8);
        r8 = (android.animation.Keyframe) r8;
        r12 = r8.getFraction();
        r14 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        r19 = (r12 > r14 ? 1 : (r12 == r14 ? 0 : -1));
        if (r19 >= 0) goto L_0x022a;
    L_0x0213:
        r19 = 0;
        r12 = (r12 > r19 ? 1 : (r12 == r19 ? 0 : -1));
        if (r12 >= 0) goto L_0x021d;
    L_0x0219:
        r8.setFraction(r14);
        goto L_0x022a;
    L_0x021d:
        r12 = r15.size();
        r8 = b(r8, r14);
        r15.add(r12, r8);
        r2 = r2 + 1;
    L_0x022a:
        r8 = r5.getFraction();
        r12 = 0;
        r14 = (r8 > r12 ? 1 : (r8 == r12 ? 0 : -1));
        if (r14 == 0) goto L_0x0245;
    L_0x0233:
        r8 = (r8 > r12 ? 1 : (r8 == r12 ? 0 : -1));
        if (r8 >= 0) goto L_0x023b;
    L_0x0237:
        r5.setFraction(r12);
        goto L_0x0245;
    L_0x023b:
        r5 = b(r5, r12);
        r8 = 0;
        r15.add(r8, r5);
        r2 = r2 + 1;
    L_0x0245:
        r5 = new android.animation.Keyframe[r2];
        r15.toArray(r5);
        r8 = 0;
    L_0x024b:
        if (r8 >= r2) goto L_0x02bd;
    L_0x024d:
        r12 = r5[r8];
        r14 = r12.getFraction();
        r15 = 0;
        r14 = (r14 > r15 ? 1 : (r14 == r15 ? 0 : -1));
        if (r14 >= 0) goto L_0x02b4;
    L_0x0258:
        if (r8 != 0) goto L_0x025e;
    L_0x025a:
        r12.setFraction(r15);
        goto L_0x02b4;
    L_0x025e:
        r14 = r2 + -1;
        if (r8 != r14) goto L_0x0268;
    L_0x0262:
        r14 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        r12.setFraction(r14);
        goto L_0x02b4;
    L_0x0268:
        r12 = r8 + 1;
        r15 = r8;
    L_0x026b:
        if (r12 >= r14) goto L_0x0282;
    L_0x026d:
        r19 = r5[r12];
        r19 = r19.getFraction();
        r20 = 0;
        r19 = (r19 > r20 ? 1 : (r19 == r20 ? 0 : -1));
        if (r19 < 0) goto L_0x027a;
    L_0x0279:
        goto L_0x0282;
    L_0x027a:
        r15 = r12 + 1;
        r21 = r15;
        r15 = r12;
        r12 = r21;
        goto L_0x026b;
    L_0x0282:
        r12 = r15 + 1;
        r12 = r5[r12];
        r12 = r12.getFraction();
        r14 = r8 + -1;
        r14 = r5[r14];
        r14 = r14.getFraction();
        r12 = r12 - r14;
        r14 = r15 - r8;
        r14 = r14 + 2;
        r14 = (float) r14;
        r12 = r12 / r14;
        r14 = r8;
    L_0x029a:
        if (r14 > r15) goto L_0x02b4;
    L_0x029c:
        r19 = r2;
        r2 = r5[r14];
        r20 = r14 + -1;
        r20 = r5[r20];
        r20 = r20.getFraction();
        r9 = r20 + r12;
        r2.setFraction(r9);
        r14 = r14 + 1;
        r9 = r22;
        r2 = r19;
        goto L_0x029a;
    L_0x02b4:
        r19 = r2;
        r8 = r8 + 1;
        r9 = r22;
        r2 = r19;
        goto L_0x024b;
    L_0x02bd:
        r2 = android.animation.PropertyValuesHolder.ofKeyframe(r7, r5);
        r5 = 3;
        if (r1 != r5) goto L_0x02cc;
    L_0x02c4:
        r1 = b.s.a.a.d.a;
        r2.setEvaluator(r1);
        goto L_0x02cc;
    L_0x02ca:
        r5 = 3;
        r2 = 0;
    L_0x02cc:
        r1 = 1;
        r8 = 0;
        if (r2 != 0) goto L_0x02d4;
    L_0x02d0:
        r2 = c(r3, r4, r8, r1, r7);
    L_0x02d4:
        if (r2 == 0) goto L_0x02e1;
    L_0x02d6:
        if (r6 != 0) goto L_0x02de;
    L_0x02d8:
        r4 = new java.util.ArrayList;
        r4.<init>();
        r6 = r4;
    L_0x02de:
        r6.add(r2);
    L_0x02e1:
        r3.recycle();
        r2 = r5;
        r3 = 1;
        goto L_0x02ed;
    L_0x02e7:
        r16 = r1;
        r17 = r5;
        r18 = r12;
    L_0x02ed:
        r25.next();
        r4 = 2;
        r8 = r23;
        r9 = r24;
        r1 = r16;
        r5 = r17;
        r12 = r18;
        goto L_0x00b4;
    L_0x02fd:
        r18 = r12;
        if (r6 == 0) goto L_0x0315;
    L_0x0301:
        r1 = r6.size();
        r2 = new android.animation.PropertyValuesHolder[r1];
        r3 = 0;
    L_0x0308:
        if (r3 >= r1) goto L_0x0316;
    L_0x030a:
        r4 = r6.get(r3);
        r4 = (android.animation.PropertyValuesHolder) r4;
        r2[r3] = r4;
        r3 = r3 + 1;
        goto L_0x0308;
    L_0x0315:
        r2 = 0;
    L_0x0316:
        if (r2 == 0) goto L_0x0322;
    L_0x0318:
        r1 = r0 instanceof android.animation.ValueAnimator;
        if (r1 == 0) goto L_0x0322;
    L_0x031c:
        r1 = r0;
        r1 = (android.animation.ValueAnimator) r1;
        r1.setValues(r2);
    L_0x0322:
        r14 = 1;
    L_0x0323:
        if (r11 == 0) goto L_0x0331;
    L_0x0325:
        if (r14 != 0) goto L_0x0331;
    L_0x0327:
        if (r13 != 0) goto L_0x032e;
    L_0x0329:
        r13 = new java.util.ArrayList;
        r13.<init>();
    L_0x032e:
        r13.add(r0);
    L_0x0331:
        r8 = r23;
        r9 = r24;
        r12 = r18;
        goto L_0x000f;
    L_0x0339:
        r0 = new java.lang.RuntimeException;
        r1 = "Unknown animator name: ";
        r1 = c.b.a.a.a.g(r1);
        r2 = r25.getName();
        r1.append(r2);
        r1 = r1.toString();
        r0.<init>(r1);
        throw r0;
    L_0x0350:
        if (r11 == 0) goto L_0x037a;
    L_0x0352:
        if (r13 == 0) goto L_0x037a;
    L_0x0354:
        r1 = r13.size();
        r1 = new android.animation.Animator[r1];
        r2 = r13.iterator();
        r3 = 0;
    L_0x035f:
        r4 = r2.hasNext();
        if (r4 == 0) goto L_0x0371;
    L_0x0365:
        r4 = r2.next();
        r4 = (android.animation.Animator) r4;
        r5 = r3 + 1;
        r1[r3] = r4;
        r3 = r5;
        goto L_0x035f;
    L_0x0371:
        if (r28 != 0) goto L_0x0377;
    L_0x0373:
        r11.playTogether(r1);
        goto L_0x037a;
    L_0x0377:
        r11.playSequentially(r1);
    L_0x037a:
        return r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.s.a.a.c.a(android.content.Context, android.content.res.Resources, android.content.res.Resources$Theme, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.animation.AnimatorSet, int, float):android.animation.Animator");
    }

    public static Keyframe b(Keyframe keyframe, float f) {
        if (keyframe.getType() == Float.TYPE) {
            return Keyframe.ofFloat(f);
        }
        if (keyframe.getType() == Integer.TYPE) {
            return Keyframe.ofInt(f);
        }
        return Keyframe.ofObject(f);
    }

    public static PropertyValuesHolder c(TypedArray typedArray, int i, int i2, int i3, String str) {
        TypedValue peekValue = typedArray.peekValue(i2);
        Object obj = peekValue != null ? 1 : null;
        int i4 = obj != null ? peekValue.type : 0;
        TypedValue peekValue2 = typedArray.peekValue(i3);
        Object obj2 = peekValue2 != null ? 1 : null;
        int i5 = obj2 != null ? peekValue2.type : 0;
        if (i == 4) {
            i = ((obj == null || !d(i4)) && (obj2 == null || !d(i5))) ? 0 : 3;
        }
        Object obj3 = i == 0 ? 1 : null;
        PropertyValuesHolder propertyValuesHolder = null;
        PropertyValuesHolder ofObject;
        if (i == 2) {
            String string = typedArray.getString(i2);
            String string2 = typedArray.getString(i3);
            b.i.d.c[] g0 = f.g0(string);
            b.i.d.c[] g02 = f.g0(string2);
            if (g0 == null && g02 == null) {
                return null;
            }
            if (g0 != null) {
                a aVar = new a();
                if (g02 == null) {
                    ofObject = PropertyValuesHolder.ofObject(str, aVar, new Object[]{g0});
                } else if (f.I(g0, g02)) {
                    ofObject = PropertyValuesHolder.ofObject(str, aVar, new Object[]{g0, g02});
                } else {
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.append(" Can't morph from ");
                    stringBuilder.append(string);
                    stringBuilder.append(" to ");
                    stringBuilder.append(string2);
                    throw new InflateException(stringBuilder.toString());
                }
                return ofObject;
            } else if (g02 == null) {
                return null;
            } else {
                return PropertyValuesHolder.ofObject(str, new a(), new Object[]{g02});
            }
        }
        TypeEvaluator typeEvaluator = i == 3 ? d.a : null;
        int dimension;
        if (obj3 != null) {
            float dimension2;
            if (obj != null) {
                float dimension3;
                if (i4 == 5) {
                    dimension3 = typedArray.getDimension(i2, 0.0f);
                } else {
                    dimension3 = typedArray.getFloat(i2, 0.0f);
                }
                if (obj2 != null) {
                    if (i5 == 5) {
                        dimension2 = typedArray.getDimension(i3, 0.0f);
                    } else {
                        dimension2 = typedArray.getFloat(i3, 0.0f);
                    }
                    ofObject = PropertyValuesHolder.ofFloat(str, new float[]{dimension3, dimension2});
                } else {
                    ofObject = PropertyValuesHolder.ofFloat(str, new float[]{dimension3});
                }
            } else {
                if (i5 == 5) {
                    dimension2 = typedArray.getDimension(i3, 0.0f);
                } else {
                    dimension2 = typedArray.getFloat(i3, 0.0f);
                }
                ofObject = PropertyValuesHolder.ofFloat(str, new float[]{dimension2});
            }
        } else if (obj != null) {
            if (i4 == 5) {
                i2 = (int) typedArray.getDimension(i2, 0.0f);
            } else if (d(i4)) {
                i2 = typedArray.getColor(i2, 0);
            } else {
                i2 = typedArray.getInt(i2, 0);
            }
            if (obj2 != null) {
                if (i5 == 5) {
                    dimension = (int) typedArray.getDimension(i3, 0.0f);
                } else if (d(i5)) {
                    dimension = typedArray.getColor(i3, 0);
                } else {
                    dimension = typedArray.getInt(i3, 0);
                }
                ofObject = PropertyValuesHolder.ofInt(str, new int[]{i2, dimension});
            } else {
                ofObject = PropertyValuesHolder.ofInt(str, new int[]{i2});
            }
        } else {
            if (obj2 != null) {
                if (i5 == 5) {
                    dimension = (int) typedArray.getDimension(i3, 0.0f);
                } else if (d(i5)) {
                    dimension = typedArray.getColor(i3, 0);
                } else {
                    dimension = typedArray.getInt(i3, 0);
                }
                ofObject = PropertyValuesHolder.ofInt(str, new int[]{dimension});
            }
            if (propertyValuesHolder == null && typeEvaluator != null) {
                propertyValuesHolder.setEvaluator(typeEvaluator);
                return propertyValuesHolder;
            }
        }
        propertyValuesHolder = ofObject;
        return propertyValuesHolder == null ? propertyValuesHolder : propertyValuesHolder;
    }

    public static boolean d(int i) {
        return i >= 28 && i <= 31;
    }

    public static ValueAnimator e(Context context, Resources resources, Theme theme, AttributeSet attributeSet, ValueAnimator valueAnimator, float f, XmlPullParser xmlPullParser) throws NotFoundException {
        int i;
        ValueAnimator valueAnimator2;
        TypedArray typedArray;
        TypedArray typedArray2;
        ValueAnimator valueAnimator3;
        Resources resources2 = resources;
        Theme theme2 = theme;
        AttributeSet attributeSet2 = attributeSet;
        XmlPullParser xmlPullParser2 = xmlPullParser;
        TypedArray e = h.e(resources2, theme2, attributeSet2, a.g);
        TypedArray e2 = h.e(resources2, theme2, attributeSet2, a.k);
        ValueAnimator valueAnimator4 = valueAnimator == null ? new ValueAnimator() : valueAnimator;
        int i2 = 300;
        if (h.c(xmlPullParser2, "duration")) {
            i2 = e.getInt(1, 300);
        }
        long j = (long) i2;
        int i3 = 0;
        if (h.c(xmlPullParser2, "startOffset")) {
            i = e.getInt(2, 0);
        } else {
            i = 0;
        }
        long j2 = (long) i;
        if (h.c(xmlPullParser2, "valueType")) {
            i = e.getInt(7, 4);
        } else {
            i = 4;
        }
        if (h.c(xmlPullParser2, "valueFrom") && h.c(xmlPullParser2, "valueTo")) {
            if (i == 4) {
                TypedValue peekValue = e.peekValue(5);
                Object obj = peekValue != null ? 1 : null;
                i = obj != null ? peekValue.type : 0;
                TypedValue peekValue2 = e.peekValue(6);
                Object obj2 = peekValue2 != null ? 1 : null;
                i = ((obj == null || !d(i)) && (obj2 == null || !d(obj2 != null ? peekValue2.type : 0))) ? 0 : 3;
            }
            if (c(e, i, 5, 6, "") != null) {
                valueAnimator4.setValues(new PropertyValuesHolder[]{c(e, i, 5, 6, "")});
            }
        }
        valueAnimator4.setDuration(j);
        valueAnimator4.setStartDelay(j2);
        if (h.c(xmlPullParser2, "repeatCount")) {
            i = e.getInt(3, 0);
        } else {
            i = 0;
        }
        valueAnimator4.setRepeatCount(i);
        if (h.c(xmlPullParser2, "repeatMode")) {
            i = e.getInt(4, 1);
        } else {
            i = 1;
        }
        valueAnimator4.setRepeatMode(i);
        if (e2 != null) {
            ObjectAnimator objectAnimator = (ObjectAnimator) valueAnimator4;
            String b = h.b(e2, xmlPullParser2, "pathData", 1);
            if (b != null) {
                String b2 = h.b(e2, xmlPullParser2, "propertyXName", 2);
                String b3 = h.b(e2, xmlPullParser2, "propertyYName", 3);
                if (b2 == null && b3 == null) {
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.append(e2.getPositionDescription());
                    stringBuilder.append(" propertyXName or propertyYName is needed for PathData");
                    throw new InflateException(stringBuilder.toString());
                }
                float[] fArr;
                Path i0 = f.i0(b);
                float f2 = 0.5f * f;
                PathMeasure pathMeasure = new PathMeasure(i0, false);
                ArrayList arrayList = new ArrayList();
                arrayList.add(Float.valueOf(0.0f));
                float f3 = 0.0f;
                do {
                    f3 += pathMeasure.getLength();
                    arrayList.add(Float.valueOf(f3));
                } while (pathMeasure.nextContour());
                pathMeasure = new PathMeasure(i0, false);
                i2 = Math.min(100, ((int) (f3 / f2)) + 1);
                float[] fArr2 = new float[i2];
                float[] fArr3 = new float[i2];
                float[] fArr4 = new float[2];
                f3 /= (float) (i2 - 1);
                valueAnimator2 = valueAnimator4;
                typedArray = e;
                int i4 = 0;
                float f4 = 0.0f;
                while (true) {
                    fArr = null;
                    if (i3 >= i2) {
                        break;
                    }
                    int i5 = i2;
                    pathMeasure.getPosTan(f4 - ((Float) arrayList.get(i4)).floatValue(), fArr4, null);
                    fArr2[i3] = fArr4[0];
                    fArr3[i3] = fArr4[1];
                    f4 += f3;
                    int i6 = i4 + 1;
                    if (i6 < arrayList.size() && f4 > ((Float) arrayList.get(i6)).floatValue()) {
                        pathMeasure.nextContour();
                        i4 = i6;
                    }
                    i3++;
                    i2 = i5;
                }
                PropertyValuesHolder ofFloat = b2 != null ? PropertyValuesHolder.ofFloat(b2, fArr2) : null;
                if (b3 != null) {
                    fArr = PropertyValuesHolder.ofFloat(b3, fArr3);
                }
                if (ofFloat == null) {
                    PropertyValuesHolder[] propertyValuesHolderArr = new PropertyValuesHolder[1];
                    i3 = 0;
                    propertyValuesHolderArr[0] = fArr;
                    objectAnimator.setValues(propertyValuesHolderArr);
                } else {
                    i3 = 0;
                    if (fArr == null) {
                        objectAnimator.setValues(new PropertyValuesHolder[]{ofFloat});
                    } else {
                        objectAnimator.setValues(new PropertyValuesHolder[]{ofFloat, fArr});
                    }
                }
            } else {
                valueAnimator2 = valueAnimator4;
                typedArray = e;
                objectAnimator.setPropertyName(h.b(e2, xmlPullParser2, "propertyName", 0));
            }
        } else {
            valueAnimator2 = valueAnimator4;
            typedArray = e;
        }
        if (h.c(xmlPullParser2, "interpolator")) {
            typedArray2 = typedArray;
            i3 = typedArray2.getResourceId(i3, i3);
        } else {
            typedArray2 = typedArray;
        }
        if (i3 > 0) {
            valueAnimator3 = valueAnimator2;
            valueAnimator3.setInterpolator(AnimationUtils.loadInterpolator(context, i3));
        } else {
            valueAnimator3 = valueAnimator2;
        }
        typedArray2.recycle();
        if (e2 != null) {
            e2.recycle();
        }
        return valueAnimator3;
    }
}
